package com.zr.serviceimpl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.zr.dao.Functiondao;
import com.zr.dao.OrderDaoLPN;
import com.zr.service.OrderServiceLPN;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

@Service("ors")
public class OrderServiceImplLPN implements OrderServiceLPN{

	
	//属性注入
			@Resource
			private  OrderDaoLPN orDao;
	@Override
	public JSONObject findOrder(int page, int rows) {
		JSONObject j = new JSONObject();
		j.put("total", orDao.getOrderCount());
		j.put("rows", orDao.findOrder(page, rows));
		
		return j;
	}
	@Override
	public int updateOR(int orId, String orState) {
		// TODO Auto-generated method stub
		return orDao.updateOR(orId, orState);
	}
	@Override
	public JSONObject getOrderByState(int page, int rows, String orState) {
		JSONObject j = new JSONObject();
		j.put("total", orDao.getOrderCount(orState));
		j.put("rows", orDao.getOrderByState(page, rows, orState));
		return j;
	}

}
